﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Message.aspx.cs" Inherits="NuaTarDoneng.Message" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .style221
        {
            width: 100%;
            color: #000000;
            font-size: x-small;
            background-color: #FFFFFF;
        }
        .style223
        {
            text-align: center;
        }
        .style226
        {
            width: 217px;
        }
        .style228
        {
        }
        .style231
        {
            width: 258px;
            text-align: right;
            height: 23px;
        }
        .style232
        {
            width: 200px;
            height: 23px;
            text-align: left;
        }
        .style233
    {
        width: 258px;
        text-align: right;
        height: 12px;
    }
    .style234
    {
        width: 200px;
        height: 12px;
    }
        </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <table class="style221">
        <tr>
            <td class="style228" colspan="2">
                欢迎大家留言！！</td>
            <td>
                留言内容(Message here)：</td>
        </tr>
        <tr>
            <td class="style231">
                *大神怎么称呼：</td>
            <td class="style234">
                <asp:TextBox ID="bigname" runat="server" MaxLength="30"></asp:TextBox>
            </td>
            <td rowspan="3">
                <asp:TextBox ID="bigmessage" runat="server" Height="81px" MaxLength="500" 
                    TextMode="MultiLine" Width="377px"></asp:TextBox>
                不超过500字</td>
        </tr>
        <tr>
            <td class="style233">
                *大神的邮箱：</td>
            <td class="style234">
                <asp:TextBox ID="bigemail" runat="server" MaxLength="30" ></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style233">
                大神的网站或博客：</td>
            <td class="style234">
                <asp:TextBox ID="bigweb" runat="server" MaxLength="60" ></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style223" colspan="3">
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                    ControlToValidate="bigemail" ErrorMessage="邮箱不能为空（不会被显示）" 
                    style="color: #FF0000" ValidationGroup="valiGroup1"></asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                    ControlToValidate="bigemail" ErrorMessage="邮箱格式错误" style="color: #FF0000" 
                    ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" 
                    ValidationGroup="valiGroup1"></asp:RegularExpressionValidator>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                    ControlToValidate="bigname" ErrorMessage="姓名不能为空" style="color: #FF0000" 
                    ValidationGroup="valiGroup1"></asp:RequiredFieldValidator>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" 
                    runat="server" ControlToValidate="bigmessage" ErrorMessage="留言内容不能为空" 
                    style="color: #FF0000" ValidationGroup="valiGroup1"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td class="style223" colspan="3">
                <asp:Button ID="Button1" runat="server" Text="留言" onclick="Button1_Click" 
                    ValidationGroup="valiGroup1" />
            </td>
        </tr>
    </table>
    <hr style="height: 7px; color: #CC6699; background-color: #CC6699;" />
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        SelectCommand="SELECT * FROM [Message] ORDER BY [CreatDate] DESC">
    </asp:SqlDataSource>
    <asp:ListView ID="ListView1" runat="server" DataKeyNames="tagID" 
        DataSourceID="SqlDataSource1">
        
        <EmptyDataTemplate>
            <span>未返回数据。</span>
        </EmptyDataTemplate>
        
        <ItemTemplate>
           <table class="style230" style="background:gray;width:750px;margin:20px 0px 30px 0px;padding:0px;border:none;color:Black">
                    <tr  style="font-style: italic;font-size:12px">
                        <td>
                       大神名叫： <asp:Label ID="nameLabel" runat="server" Text='<%# Eval("name") %>' />
                       </td>
                        <td style="text-align:right">
                         留言时间: <asp:Label ID="CreatDateLabel" runat="server" Text='<%# Eval("CreatDate") %>'></asp:Label>
                       </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="MessageLabel" runat="server" Text='<%# Eval("Message") %>' /></td>
                    </tr>
                    <tr  style="font-style: italic;font-size:12px">
                        <td>
                         大神的网址：<%# Eval("website") %></td>
                    </tr>
                </table>
        </ItemTemplate>
        <LayoutTemplate>
            <div ID="itemPlaceholderContainer" runat="server" style="">
                <span runat="server" id="itemPlaceholder" />
            </div>
            <div style="">
                <asp:DataPager ID="DataPager1" runat="server">
                    <Fields>
                        <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" 
                            ShowNextPageButton="False" ShowPreviousPageButton="False" />
                        <asp:NumericPagerField />
                        <asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True" 
                            ShowNextPageButton="False" ShowPreviousPageButton="False" />
                    </Fields>
                </asp:DataPager>
            </div>
        </LayoutTemplate>
       
    </asp:ListView>
</asp:Content>
